﻿using System;
using System.Collections.Generic;

namespace InvestmentIntelligence.Data.Repository.Comparers.EntityModelsComparers
{
    public class StringIgnoreCaseComparer : IEqualityComparer<string>
    {
        public bool Equals(string x, string y)
        {
            return x.Trim().Equals(y.Trim(), StringComparison.InvariantCultureIgnoreCase);
        }

        public int GetHashCode(string obj)
        {
            return string.IsNullOrWhiteSpace(obj) ? 0 : obj.GetHashCode();
        }
    }
}